package action;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import basic.PageInfo;
import basic.QuerySet;
import basic.ResultSet;
import basic.SortInfo;
import common.BaseAction;
import common.dict.CommonDict;
import dicts.RealmDict;
import entities.TBc;
import interfaces.IBcService;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import util.HttpUtil;
import util.ParameterUtil;
import utils.DateUtil;
import utils.ExcelUtil;
import utils.NumberUtil;
import utils.StringUtil;
import views.VBcCard;

public class BcAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7507534255609348887L;

	private IBcService bcService;

	private TBc bcBean;
	private List<TBc> bcList;
	private List<VBcCard> bcCardList;

	private String bcNo;
	private String bcNos;
	private String crdNo;
	private String bnkNo;
	private String txnNo;
	private String bcType;
	private String bcOrder;
	private String bcCur;
	private Double bcMoney;
	private String bcRef;
	private String bcCard;
	private String bcTime;
	private String bcMark;
	private String bcInfo;
	private Double bcAmount;
	private Double bcAmountTotal;
	private String bcCode;
	private String bcMessage;
	private String bcState;
	private Date bcDate;
	private Date bcDateTop;
	private Date bcDateEnd;
	private String bcCstate;
	private Date bcCdate;
	private Date bcCdateTop;
	private Date bcCdateEnd;
	private String bcRemark;
	
	private String crdNos;
	private String crdIp;
	private String crdOs;
	private String crdBrowser;
	private String crdFinger;
	private String crdLocale;
	private String crdTiming;
	private String crdCode;
	private String crdBin;
	private String crdType;
	private String crdFake;
	private String crdNumber;
	private String crdExpire;
	private String crdCvv;
	private String crdCfname;
	private String crdClname;
	private String crdCphone;
	private String crdCemail;
	private String crdCcountry;
	private String crdCstate;
	private String crdCcity;
	private String crdCaddr;
	private String crdCzip;
	private String crdHfname;
	private String crdHlname;
	private String crdHphone;
	private String crdHemail;
	private String crdHcountry;
	private String crdHstate;
	private String crdHcity;
	private String crdHaddr;
	private String crdHzip;
	private String crdState;
	private Date crdDate;
	private Date crdDateTop;
	private Date crdDateEnd;
	private String crdRemark;
	
	private Boolean bcSummary = new Boolean(false);
	private Boolean crdJoin = new Boolean(false);

	// 展示对象
	public String show() throws Exception {
		if (!bcService.exist(bcNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			bcBean = bcService.fetch(bcNo);
			return SUCCESS;
		}
	}

	// 编辑对象
	public String edit() throws Exception {
		if (!bcService.exist(bcNo)) {
			bcBean = new TBc();
		} else {
			bcBean = bcService.fetch(bcNo);
		}
		return SUCCESS;
	}

	// 编辑对象
	public String editrefund() throws Exception {
		if (!bcService.exist(bcNo)) {
			addActionError("数据不存在");
			return INFO;
		} else {
			bcBean = bcService.fetch(bcNo);
			return SUCCESS;
		}
	}

	// 持久化对象
	public String save() throws Exception {
		if (!bcService.exist(bcNo)) {
			addActionError("数据不存在");
			return INFO;
		} 
			bcBean = bcService.fetch(bcNo);
		
		bcBean.setBcNo(bcNo);
		bcBean.setCrdNo(crdNo);
		bcBean.setBnkNo(bnkNo);
		bcBean.setTxnNo(txnNo);
		bcBean.setBcType(bcType);
		bcBean.setBcOrder(bcOrder);
		bcBean.setBcCur(bcCur);
		bcBean.setBcMoney(bcMoney);
		bcBean.setBcRef(bcRef);
		bcBean.setBcCard(bcCard);
		bcBean.setBcTime(bcTime);
		bcBean.setBcMark(bcMark);
		bcBean.setBcInfo(bcInfo);
		bcBean.setBcAmount(bcAmount);
		bcBean.setBcCode(bcCode);
		bcBean.setBcMessage(bcMessage);
		bcBean.setBcState(bcState);
		bcBean.setBcDate(bcDate);
		bcBean.setBcCstate(bcCstate);
		bcBean.setBcCdate(bcCdate);
		bcBean.setBcRemark(bcRemark);

		bcService.persist(bcBean);
		return SUCCESS;
	}

	// 持久化对象
	public String saverefund() throws Exception {
		JSONObject resultMap = new JSONObject();
		Map<String, String> paramsMap = new HashMap<String, String>();
		paramsMap.put("bcNo", bcNo);
		paramsMap.put("bcAmount", NumberUtil.transfer(bcAmount));
		paramsMap.put("bcRemark", bcRemark);
		resultMap = JSONObject.fromObject(new HttpUtil().post(RealmDict.GATEWAY + "Force", paramsMap));
		addActionError("返回码["+resultMap.getString("code")+"]返回信息["+resultMap.getString("message")+"]");
		return SUCCESS;
	}

	// AUTOCOMPLATE功能
	public void auto() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("bcNo", StringUtil.split(bcNo));

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField("bcNo");
		sortInfo.setSortOrder(new Boolean(true));

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TBc> resultSet = bcService.search(querySet);
		bcList = resultSet.getResultList();

		HttpServletResponse response = ServletActionContext.getResponse();
		response.setContentType("text/html;charset=UTF-8");
		response.getWriter().println(JSONArray.fromObject(bcList).toString());
	}

	public String listrefund() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("bcNo", StringUtil.split(bcNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("bnkNo", bnkNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("bcType", bcType);
		paramMap.put("bcOrder", bcOrder);
		paramMap.put("bcCur", bcCur);
		paramMap.put("bcMoney", bcMoney);
		paramMap.put("bcRef", StringUtil.split(bcRef));
		paramMap.put("bcCard", StringUtil.split(bcCard));
		paramMap.put("bcTime", bcTime);
		paramMap.put("bcMark", bcMark);
		paramMap.put("bcInfo", bcInfo);
		paramMap.put("bcAmount", bcAmount);
		paramMap.put("bcCode", bcCode);
		paramMap.put("bcMessage", bcMessage);
		paramMap.put("bcState", "1");
		paramMap.put("bcDate", ParameterUtil.dateCombin(bcDateTop, bcDateEnd));
		paramMap.put("bcCstate", bcCstate);
		paramMap.put("bcCdate", ParameterUtil.dateCombin(bcCdateTop, bcCdateEnd));
		paramMap.put("bcRemark", bcRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "bcDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TBc> resultSet = bcService.search(querySet);
		bcList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		return SUCCESS;
	}

	// 列表展示
	public String view() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("bcNo", StringUtil.split(bcNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("bnkNo", bnkNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("bcType", bcType);
		paramMap.put("bcOrder", bcOrder);
		paramMap.put("bcCur", bcCur);
		paramMap.put("bcMoney", bcMoney);
		paramMap.put("bcRef", StringUtil.split(bcRef));
		paramMap.put("bcCard", StringUtil.split(bcCard));
		paramMap.put("bcTime", bcTime);
		paramMap.put("bcMark", bcMark);
		paramMap.put("bcInfo", bcInfo);
		paramMap.put("bcAmount", bcAmount);
		paramMap.put("bcCode", bcCode);
		paramMap.put("bcMessage", bcMessage);
		paramMap.put("bcState", bcState);
		paramMap.put("bcDate", ParameterUtil.dateCombin(bcDateTop, bcDateEnd));
		paramMap.put("bcCstate", bcCstate);
		paramMap.put("bcCdate", ParameterUtil.dateCombin(bcCdateTop, bcCdateEnd));
		paramMap.put("bcRemark", bcRemark);
		if (crdJoin) {
			paramMap.put("crdNo", StringUtil.split(crdNo));
			paramMap.put("crdIp", crdIp);
			paramMap.put("crdOs", crdOs);
			paramMap.put("crdBrowser", crdBrowser);
			paramMap.put("crdFinger", crdFinger);
			paramMap.put("crdLocale", crdLocale);
			paramMap.put("crdTiming", crdTiming);
			paramMap.put("crdCode", crdCode);
			paramMap.put("crdBin", crdBin);
			paramMap.put("crdType", crdType);
			paramMap.put("crdFake", crdFake);
			paramMap.put("crdNumber", crdNumber);
			paramMap.put("crdCfname", crdCfname);
			paramMap.put("crdClname", crdClname);
			paramMap.put("crdCphone", crdCphone);
			paramMap.put("crdCemail", crdCemail);
			paramMap.put("crdCcountry", crdCcountry);
			paramMap.put("crdCstate", crdCstate);
			paramMap.put("crdCcity", crdCcity);
			paramMap.put("crdCaddr", crdCaddr);
			paramMap.put("crdCzip", crdCzip);
			paramMap.put("crdHfname", crdHfname);
			paramMap.put("crdHlname", crdHlname);
			paramMap.put("crdHphone", crdHphone);
			paramMap.put("crdHemail", crdHemail);
			paramMap.put("crdHcountry", crdHcountry);
			paramMap.put("crdHstate", crdHstate);
			paramMap.put("crdHcity", crdHcity);
			paramMap.put("crdHaddr", crdHaddr);
			paramMap.put("crdHzip", crdHzip);
			paramMap.put("crdState", crdState);
			paramMap.put("crdDate", ParameterUtil.dateCombin(crdDateTop, crdDateEnd));
			paramMap.put("crdRemark", crdRemark);
		}

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "bcDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(pageIndex, pageSize));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<VBcCard> resultSet = bcService.relate(querySet);
		bcCardList = resultSet.getResultList();
		pageInfo = resultSet.getPageInfo();
		
		if(bcSummary){
			querySet.setPolymerizeInfo("bcAmount");
			bcAmountTotal=bcService.collect(querySet);
		}
		return SUCCESS;
	}

	// 导出数据 查询条件等同于列表查询条件
	public String export() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("bcNo", StringUtil.split(bcNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("bnkNo", bnkNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("bcType", bcType);
		paramMap.put("bcOrder", bcOrder);
		paramMap.put("bcCur", bcCur);
		paramMap.put("bcMoney", bcMoney);
		paramMap.put("bcRef", StringUtil.split(bcRef));
		paramMap.put("bcCard", StringUtil.split(bcCard));
		paramMap.put("bcTime", bcTime);
		paramMap.put("bcMark", bcMark);
		paramMap.put("bcInfo", bcInfo);
		paramMap.put("bcAmount", bcAmount);
		paramMap.put("bcCode", bcCode);
		paramMap.put("bcMessage", bcMessage);
		paramMap.put("bcState", bcState);
		paramMap.put("bcDate", ParameterUtil.dateCombin(bcDateTop, bcDateEnd));
		paramMap.put("bcCstate", bcCstate);
		paramMap.put("bcCdate", ParameterUtil.dateCombin(bcCdateTop, bcCdateEnd));
		paramMap.put("bcRemark", bcRemark);

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "bcDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);

		ResultSet<TBc> resultSet = bcService.search(querySet);
		bcList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联卡号");
		fieldHead.add("收单银行");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("上送流水号");
		fieldHead.add("上送币种");
		fieldHead.add("上送金额");
		fieldHead.add("返回银行单号");
		fieldHead.add("返回原交易卡号");
		fieldHead.add("返回原交易日期");
		fieldHead.add("返回码");
		fieldHead.add("返回信息");
		fieldHead.add("入账金额");
		fieldHead.add("入账码");
		fieldHead.add("入账信息");
		fieldHead.add("入账状态");
		fieldHead.add("入账日期日期");
		fieldHead.add("入账日期时间");
		fieldHead.add("对账状态");
		fieldHead.add("对账日期日期");
		fieldHead.add("对账日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (TBc bcBean : bcList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(bcBean.getBcNo());
			fieldItem.add(bcBean.getCrdNo());
			fieldItem.add(bcBean.getBnkNo());
			fieldItem.add(bcBean.getTxnNo());
			fieldItem.add(bcBean.getBcType());
			fieldItem.add(bcBean.getBcOrder());
			fieldItem.add(bcBean.getBcCur());
			fieldItem.add(bcBean.getBcMoney().toString());
			fieldItem.add(bcBean.getBcRef());
			fieldItem.add(bcBean.getBcCard());
			fieldItem.add(bcBean.getBcTime());
			fieldItem.add(bcBean.getBcMark());
			fieldItem.add(bcBean.getBcInfo());
			fieldItem.add(bcBean.getBcAmount().toString());
			fieldItem.add(bcBean.getBcCode());
			fieldItem.add(bcBean.getBcMessage());
			fieldItem.add((bcBean.getBcState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(bcBean.getBcDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(bcBean.getBcDate(), DateUtil.TIME));
			fieldItem.add((bcBean.getBcCstate().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(bcBean.getBcCdate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(bcBean.getBcCdate(), DateUtil.TIME));
			fieldItem.add(bcBean.getBcRemark());

			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	// 导出视图 查询条件等同于列表查询条件
	public String educe() throws Exception {
		QuerySet<Object> querySet = new QuerySet<Object>();

		HashMap<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("bcNo", StringUtil.split(bcNo));
		paramMap.put("crdNo", crdNo);
		paramMap.put("bnkNo", bnkNo);
		paramMap.put("txnNo", txnNo);
		paramMap.put("bcType", bcType);
		paramMap.put("bcOrder", bcOrder);
		paramMap.put("bcCur", bcCur);
		paramMap.put("bcMoney", bcMoney);
		paramMap.put("bcRef", StringUtil.split(bcRef));
		paramMap.put("bcCard", StringUtil.split(bcCard));
		paramMap.put("bcTime", bcTime);
		paramMap.put("bcMark", bcMark);
		paramMap.put("bcInfo", bcInfo);
		paramMap.put("bcAmount", bcAmount);
		paramMap.put("bcCode", bcCode);
		paramMap.put("bcMessage", bcMessage);
		paramMap.put("bcState", bcState);
		paramMap.put("bcDate", ParameterUtil.dateCombin(bcDateTop, bcDateEnd));
		paramMap.put("bcCstate", bcCstate);
		paramMap.put("bcCdate", ParameterUtil.dateCombin(bcCdateTop, bcCdateEnd));
		paramMap.put("bcRemark", bcRemark);
		if (crdJoin) {
			paramMap.put("crdNo", StringUtil.split(crdNo));
			paramMap.put("crdIp", crdIp);
			paramMap.put("crdOs", crdOs);
			paramMap.put("crdBrowser", crdBrowser);
			paramMap.put("crdFinger", crdFinger);
			paramMap.put("crdLocale", crdLocale);
			paramMap.put("crdTiming", crdTiming);
			paramMap.put("crdCode", crdCode);
			paramMap.put("crdBin", crdBin);
			paramMap.put("crdType", crdType);
			paramMap.put("crdFake", crdFake);
			paramMap.put("crdNumber", crdNumber);
			paramMap.put("crdCfname", crdCfname);
			paramMap.put("crdClname", crdClname);
			paramMap.put("crdCphone", crdCphone);
			paramMap.put("crdCemail", crdCemail);
			paramMap.put("crdCcountry", crdCcountry);
			paramMap.put("crdCstate", crdCstate);
			paramMap.put("crdCcity", crdCcity);
			paramMap.put("crdCaddr", crdCaddr);
			paramMap.put("crdCzip", crdCzip);
			paramMap.put("crdHfname", crdHfname);
			paramMap.put("crdHlname", crdHlname);
			paramMap.put("crdHphone", crdHphone);
			paramMap.put("crdHemail", crdHemail);
			paramMap.put("crdHcountry", crdHcountry);
			paramMap.put("crdHstate", crdHstate);
			paramMap.put("crdHcity", crdHcity);
			paramMap.put("crdHaddr", crdHaddr);
			paramMap.put("crdHzip", crdHzip);
			paramMap.put("crdState", crdState);
			paramMap.put("crdDate", ParameterUtil.dateCombin(crdDateTop, crdDateEnd));
			paramMap.put("crdRemark", crdRemark);
		}

		SortInfo sortInfo = new SortInfo();
		sortInfo.setSortField((StringUtil.isEmpty(sortField)) ? "bcDate" : sortField);
		sortInfo.setSortOrder(sortOrder);

		querySet.setPageInfo(new PageInfo(1, CommonDict.EXPORT_LIMIT));
		querySet.setSortInfo(sortInfo);
		querySet.setParamMap(paramMap);
		
		ResultSet<VBcCard> resultSet = bcService.relate(querySet);
		bcCardList = resultSet.getResultList();

		List<String> fieldHead = new ArrayList<String>();
		fieldHead.add("编号");
		fieldHead.add("关联卡号");
		fieldHead.add("收单银行");
		fieldHead.add("关联交易号");
		fieldHead.add("类型");
		fieldHead.add("上送流水号");
		fieldHead.add("上送币种");
		fieldHead.add("上送金额");
		fieldHead.add("返回银行单号");
		fieldHead.add("返回原交易卡号");
		fieldHead.add("返回原交易日期");
		fieldHead.add("返回码");
		fieldHead.add("返回信息");
		fieldHead.add("入账金额");
		fieldHead.add("入账码");
		fieldHead.add("入账信息");
		fieldHead.add("入账状态");
		fieldHead.add("入账日期日期");
		fieldHead.add("入账日期时间");
		fieldHead.add("对账状态");
		fieldHead.add("对账日期日期");
		fieldHead.add("对账日期时间");
		fieldHead.add("备注");

		fieldHead.add("卡编号");
		fieldHead.add("ip地址");
		fieldHead.add("操作系统");
		fieldHead.add("浏览器");
		fieldHead.add("指纹");
		fieldHead.add("语言");
		fieldHead.add("时区");
		fieldHead.add("ip国家码");
		fieldHead.add("bin国家码");
		fieldHead.add("类型");
		fieldHead.add("伪卡号");
		fieldHead.add("卡号");
		fieldHead.add("收货人firstname");
		fieldHead.add("收货人lastname");
		fieldHead.add("收货人电话");
		fieldHead.add("收货人邮件");
		fieldHead.add("收货人国家");
		fieldHead.add("收货人州/省");
		fieldHead.add("收货人城市");
		fieldHead.add("收货人地址");
		fieldHead.add("收货人邮编");
		fieldHead.add("持卡人firstname");
		fieldHead.add("持卡人lastname");
		fieldHead.add("持卡人电话");
		fieldHead.add("持卡人邮箱");
		fieldHead.add("持卡人国家");
		fieldHead.add("持卡人州/省");
		fieldHead.add("持卡人城市");
		fieldHead.add("持卡人地址");
		fieldHead.add("持卡人邮编");
		fieldHead.add("状态");
		fieldHead.add("日期日期");
		fieldHead.add("日期时间");
		fieldHead.add("备注");

		List<List<String>> fieldData = new ArrayList<List<String>>();

		for (VBcCard bcCardBean : bcCardList) {
			List<String> fieldItem = new ArrayList<String>();
			fieldItem.add(bcCardBean.getBcNo());
			fieldItem.add(bcCardBean.getCrdNo());
			fieldItem.add(bcCardBean.getBnkNo());
			fieldItem.add(bcCardBean.getTxnNo());
			fieldItem.add(bcCardBean.getBcType());
			fieldItem.add(bcCardBean.getBcOrder());
			fieldItem.add(bcCardBean.getBcCur());
			fieldItem.add(bcCardBean.getBcMoney().toString());
			fieldItem.add(bcCardBean.getBcRef());
			fieldItem.add(bcCardBean.getBcCard());
			fieldItem.add(bcCardBean.getBcTime());
			fieldItem.add(bcCardBean.getBcMark());
			fieldItem.add(bcCardBean.getBcInfo());
			fieldItem.add(bcCardBean.getBcAmount().toString());
			fieldItem.add(bcCardBean.getBcCode());
			fieldItem.add(bcCardBean.getBcMessage());
			fieldItem.add((bcCardBean.getBcState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(bcCardBean.getBcDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(bcCardBean.getBcDate(), DateUtil.TIME));
			fieldItem.add((bcCardBean.getBcCstate().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(bcCardBean.getBcCdate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(bcCardBean.getBcCdate(), DateUtil.TIME));
			fieldItem.add(bcCardBean.getBcRemark());

			fieldItem.add(bcCardBean.getCrdNo());
			fieldItem.add(bcCardBean.getCrdIp());
			fieldItem.add(bcCardBean.getCrdOs());
			fieldItem.add(bcCardBean.getCrdBrowser());
			fieldItem.add(bcCardBean.getCrdFinger());
			fieldItem.add(bcCardBean.getCrdLocale());
			fieldItem.add(bcCardBean.getCrdTiming());
			fieldItem.add(bcCardBean.getCrdCode());
			fieldItem.add(bcCardBean.getCrdBin());
			fieldItem.add(bcCardBean.getCrdType());
			fieldItem.add(bcCardBean.getCrdFake());
			fieldItem.add(bcCardBean.getCrdNumber());
			fieldItem.add(bcCardBean.getCrdCfname());
			fieldItem.add(bcCardBean.getCrdClname());
			fieldItem.add(bcCardBean.getCrdCphone());
			fieldItem.add(bcCardBean.getCrdCemail());
			fieldItem.add(bcCardBean.getCrdCcountry());
			fieldItem.add(bcCardBean.getCrdCstate());
			fieldItem.add(bcCardBean.getCrdCcity());
			fieldItem.add(bcCardBean.getCrdCaddr());
			fieldItem.add(bcCardBean.getCrdCzip());
			fieldItem.add(bcCardBean.getCrdHfname());
			fieldItem.add(bcCardBean.getCrdHlname());
			fieldItem.add(bcCardBean.getCrdHphone());
			fieldItem.add(bcCardBean.getCrdHemail());
			fieldItem.add(bcCardBean.getCrdHcountry());
			fieldItem.add(bcCardBean.getCrdHstate());
			fieldItem.add(bcCardBean.getCrdHcity());
			fieldItem.add(bcCardBean.getCrdHaddr());
			fieldItem.add(bcCardBean.getCrdHzip());
			fieldItem.add((bcCardBean.getCrdState().equals("0")) ? "无效" : "有效");
			fieldItem.add(DateUtil.format(bcCardBean.getCrdDate(), DateUtil.DATE));
			fieldItem.add(DateUtil.format(bcCardBean.getCrdDate(), DateUtil.TIME));
			fieldItem.add(bcCardBean.getCrdRemark());
			fieldData.add(fieldItem);
		}

		inputStream = ExcelUtil.excel(fieldHead, fieldData);
		return SUCCESS;
	}

	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	////////////////////// ---------------------------//////////////////////////////////////////////////////////////////////////////////////////////////////////////

	public IBcService getBcService() {
		return bcService;
	}

	public void setBcService(IBcService bcService) {
		this.bcService = bcService;
	}

	public TBc getBcBean() {
		return bcBean;
	}

	public void setBcBean(TBc bcBean) {
		this.bcBean = bcBean;
	}

	public List<TBc> getBcList() {
		return bcList;
	}

	public void setBcList(List<TBc> bcList) {
		this.bcList = bcList;
	}

	public String getBcNo() {
		return bcNo;
	}

	public void setBcNo(String bcNo) {
		this.bcNo = bcNo;
	}

	public String getBcNos() {
		return bcNos;
	}

	public void setBcNos(String bcNos) {
		this.bcNos = bcNos;
	}

	public String getCrdNo() {
		return crdNo;
	}

	public void setCrdNo(String crdNo) {
		this.crdNo = crdNo;
	}

	public String getBnkNo() {
		return bnkNo;
	}

	public void setBnkNo(String bnkNo) {
		this.bnkNo = bnkNo;
	}

	public String getTxnNo() {
		return txnNo;
	}

	public void setTxnNo(String txnNo) {
		this.txnNo = txnNo;
	}

	public String getBcType() {
		return bcType;
	}

	public void setBcType(String bcType) {
		this.bcType = bcType;
	}

	public String getBcOrder() {
		return bcOrder;
	}

	public void setBcOrder(String bcOrder) {
		this.bcOrder = bcOrder;
	}

	public String getBcCur() {
		return bcCur;
	}

	public void setBcCur(String bcCur) {
		this.bcCur = bcCur;
	}

	public Double getBcMoney() {
		return bcMoney;
	}

	public void setBcMoney(Double bcMoney) {
		this.bcMoney = bcMoney;
	}

	public String getBcRef() {
		return bcRef;
	}

	public void setBcRef(String bcRef) {
		this.bcRef = bcRef;
	}

	public String getBcCard() {
		return bcCard;
	}

	public void setBcCard(String bcCard) {
		this.bcCard = bcCard;
	}

	public String getBcTime() {
		return bcTime;
	}

	public void setBcTime(String bcTime) {
		this.bcTime = bcTime;
	}

	public String getBcMark() {
		return bcMark;
	}

	public void setBcMark(String bcMark) {
		this.bcMark = bcMark;
	}

	public String getBcInfo() {
		return bcInfo;
	}

	public void setBcInfo(String bcInfo) {
		this.bcInfo = bcInfo;
	}

	public Double getBcAmount() {
		return bcAmount;
	}

	public void setBcAmount(Double bcAmount) {
		this.bcAmount = bcAmount;
	}

	public String getBcCode() {
		return bcCode;
	}

	public void setBcCode(String bcCode) {
		this.bcCode = bcCode;
	}

	public String getBcMessage() {
		return bcMessage;
	}

	public void setBcMessage(String bcMessage) {
		this.bcMessage = bcMessage;
	}

	public String getBcState() {
		return bcState;
	}

	public void setBcState(String bcState) {
		this.bcState = bcState;
	}

	public Date getBcDate() {
		return bcDate;
	}

	public void setBcDate(Date bcDate) {
		this.bcDate = bcDate;
	}

	public Date getBcDateTop() {
		return bcDateTop;
	}

	public void setBcDateTop(Date bcDateTop) {
		this.bcDateTop = bcDateTop;
	}

	public Date getBcDateEnd() {
		return bcDateEnd;
	}

	public void setBcDateEnd(Date bcDateEnd) {
		this.bcDateEnd = bcDateEnd;
	}

	public String getBcCstate() {
		return bcCstate;
	}

	public void setBcCstate(String bcCstate) {
		this.bcCstate = bcCstate;
	}

	public Date getBcCdate() {
		return bcCdate;
	}

	public void setBcCdate(Date bcCdate) {
		this.bcCdate = bcCdate;
	}

	public Date getBcCdateTop() {
		return bcCdateTop;
	}

	public void setBcCdateTop(Date bcCdateTop) {
		this.bcCdateTop = bcCdateTop;
	}

	public Date getBcCdateEnd() {
		return bcCdateEnd;
	}

	public void setBcCdateEnd(Date bcCdateEnd) {
		this.bcCdateEnd = bcCdateEnd;
	}

	public String getBcRemark() {
		return bcRemark;
	}

	public void setBcRemark(String bcRemark) {
		this.bcRemark = bcRemark;
	}

	public List<VBcCard> getBcCardList() {
		return bcCardList;
	}

	public void setBcCardList(List<VBcCard> bcCardList) {
		this.bcCardList = bcCardList;
	}

	public Boolean getCrdJoin() {
		return crdJoin;
	}

	public void setCrdJoin(Boolean crdJoin) {
		this.crdJoin = crdJoin;
	}

	public String getCrdNos() {
		return crdNos;
	}

	public void setCrdNos(String crdNos) {
		this.crdNos = crdNos;
	}

	public String getCrdIp() {
		return crdIp;
	}

	public void setCrdIp(String crdIp) {
		this.crdIp = crdIp;
	}

	public String getCrdOs() {
		return crdOs;
	}

	public void setCrdOs(String crdOs) {
		this.crdOs = crdOs;
	}

	public String getCrdBrowser() {
		return crdBrowser;
	}

	public void setCrdBrowser(String crdBrowser) {
		this.crdBrowser = crdBrowser;
	}

	public String getCrdFinger() {
		return crdFinger;
	}

	public void setCrdFinger(String crdFinger) {
		this.crdFinger = crdFinger;
	}

	public String getCrdLocale() {
		return crdLocale;
	}

	public void setCrdLocale(String crdLocale) {
		this.crdLocale = crdLocale;
	}

	public String getCrdTiming() {
		return crdTiming;
	}

	public void setCrdTiming(String crdTiming) {
		this.crdTiming = crdTiming;
	}

	public String getCrdCode() {
		return crdCode;
	}

	public void setCrdCode(String crdCode) {
		this.crdCode = crdCode;
	}

	public String getCrdBin() {
		return crdBin;
	}

	public void setCrdBin(String crdBin) {
		this.crdBin = crdBin;
	}

	public String getCrdType() {
		return crdType;
	}

	public void setCrdType(String crdType) {
		this.crdType = crdType;
	}

	public String getCrdFake() {
		return crdFake;
	}

	public void setCrdFake(String crdFake) {
		this.crdFake = crdFake;
	}

	public String getCrdNumber() {
		return crdNumber;
	}

	public void setCrdNumber(String crdNumber) {
		this.crdNumber = crdNumber;
	}

	public String getCrdExpire() {
		return crdExpire;
	}

	public void setCrdExpire(String crdExpire) {
		this.crdExpire = crdExpire;
	}

	public String getCrdCvv() {
		return crdCvv;
	}

	public void setCrdCvv(String crdCvv) {
		this.crdCvv = crdCvv;
	}

	public String getCrdCfname() {
		return crdCfname;
	}

	public void setCrdCfname(String crdCfname) {
		this.crdCfname = crdCfname;
	}

	public String getCrdClname() {
		return crdClname;
	}

	public void setCrdClname(String crdClname) {
		this.crdClname = crdClname;
	}

	public String getCrdCphone() {
		return crdCphone;
	}

	public void setCrdCphone(String crdCphone) {
		this.crdCphone = crdCphone;
	}

	public String getCrdCemail() {
		return crdCemail;
	}

	public void setCrdCemail(String crdCemail) {
		this.crdCemail = crdCemail;
	}

	public String getCrdCcountry() {
		return crdCcountry;
	}

	public void setCrdCcountry(String crdCcountry) {
		this.crdCcountry = crdCcountry;
	}

	public String getCrdCstate() {
		return crdCstate;
	}

	public void setCrdCstate(String crdCstate) {
		this.crdCstate = crdCstate;
	}

	public String getCrdCcity() {
		return crdCcity;
	}

	public void setCrdCcity(String crdCcity) {
		this.crdCcity = crdCcity;
	}

	public String getCrdCaddr() {
		return crdCaddr;
	}

	public void setCrdCaddr(String crdCaddr) {
		this.crdCaddr = crdCaddr;
	}

	public String getCrdCzip() {
		return crdCzip;
	}

	public void setCrdCzip(String crdCzip) {
		this.crdCzip = crdCzip;
	}

	public String getCrdHfname() {
		return crdHfname;
	}

	public void setCrdHfname(String crdHfname) {
		this.crdHfname = crdHfname;
	}

	public String getCrdHlname() {
		return crdHlname;
	}

	public void setCrdHlname(String crdHlname) {
		this.crdHlname = crdHlname;
	}

	public String getCrdHphone() {
		return crdHphone;
	}

	public void setCrdHphone(String crdHphone) {
		this.crdHphone = crdHphone;
	}

	public String getCrdHemail() {
		return crdHemail;
	}

	public void setCrdHemail(String crdHemail) {
		this.crdHemail = crdHemail;
	}

	public String getCrdHcountry() {
		return crdHcountry;
	}

	public void setCrdHcountry(String crdHcountry) {
		this.crdHcountry = crdHcountry;
	}

	public String getCrdHstate() {
		return crdHstate;
	}

	public void setCrdHstate(String crdHstate) {
		this.crdHstate = crdHstate;
	}

	public String getCrdHcity() {
		return crdHcity;
	}

	public void setCrdHcity(String crdHcity) {
		this.crdHcity = crdHcity;
	}

	public String getCrdHaddr() {
		return crdHaddr;
	}

	public void setCrdHaddr(String crdHaddr) {
		this.crdHaddr = crdHaddr;
	}

	public String getCrdHzip() {
		return crdHzip;
	}

	public void setCrdHzip(String crdHzip) {
		this.crdHzip = crdHzip;
	}

	public String getCrdState() {
		return crdState;
	}

	public void setCrdState(String crdState) {
		this.crdState = crdState;
	}

	public Date getCrdDate() {
		return crdDate;
	}

	public void setCrdDate(Date crdDate) {
		this.crdDate = crdDate;
	}

	public Date getCrdDateTop() {
		return crdDateTop;
	}

	public void setCrdDateTop(Date crdDateTop) {
		this.crdDateTop = crdDateTop;
	}

	public Date getCrdDateEnd() {
		return crdDateEnd;
	}

	public void setCrdDateEnd(Date crdDateEnd) {
		this.crdDateEnd = crdDateEnd;
	}

	public String getCrdRemark() {
		return crdRemark;
	}

	public void setCrdRemark(String crdRemark) {
		this.crdRemark = crdRemark;
	}

	public Boolean getBcSummary() {
		return bcSummary;
	}

	public void setBcSummary(Boolean bcSummary) {
		this.bcSummary = bcSummary;
	}

	public Double getBcAmountTotal() {
		return bcAmountTotal;
	}

	public void setBcAmountTotal(Double bcAmountTotal) {
		this.bcAmountTotal = bcAmountTotal;
	}

	
}
